<template>
	<view class="item">
		<img :src="info.files.fullurl" alt="">
		<view class="item__btn" @click="use(info.id)">
			使用
		</view>
		<view class="item__closed" @click="dele">
			<icon type="clear" size="16" />
		</view>
	</view>
</template>

<script>
	import {
		meetSignatureDel,
		meetSignAdd,
		meetSignGoods
	} from "@/api/autograph.js"
	export default {
		props: {
			info: {
				type: Object
			},
			init: {
				type: Function
			},
			meet_id:{
				type:String|Number
			}
		},
		methods: {
			async dele() {
				const res = await meetSignatureDel({
					id: this.info.id
				});
				uni.showToast({
					icon:"none",
					title:res.msg
				})
				if(res.code==1){
					this.init()
				}
				console.log(res)
			},
			async use(id){
				console.log(id+'XXXXXXXXX');
				const res= await meetSignGoods({
					meet_id:this.meet_id,
					qiming_id:id,
					sign_way:1
				});
				uni.showToast({
				  title: res.msg,
				  icon: 'none',
				  duration: 1000
				});
				setTimeout(()=>{
				  uni.navigateTo({
				    url: '/pages/tabbar-1-detial/meetingDetails/meetingDetails?id=' + this.meet_id
				  });
				},1000)
				/* if(res.code==1){
					uni.navigateBack()
				} */
			}
		}
	}
</script>

<style lang="less" scoped>
	.item {
		position: relative;
		color: #4871C0;
		width: 208rpx;
		margin-right: 32rpx;

		img {
			width: 208rpx;
			height: 208rpx;
		}

		&__btn {
			// margin-top: 22rpx;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			opacity: 1;
			border: 1px solid #4871C0;
			width: 208rpx;
			text-align: center;
			line-height: 68rpx;
			height: 68rpx;
			font-size: 28rpx;
		}

		&__closed {
			position: absolute;
			right: -6rpx;
			top: -20rpx;
		}
	}
</style>
